home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Apple Developer Connection Student Program
/
ADC Tools Sampler CD Disk 3 1999.iso
/
Cool Demos, SDKs, & Tools
/
Demos⁄Tools⁄Offers
/
Eiffel for CW beta 3
/
EiffelS2
/
EIFFEL2.H
< prev
next >
Wrap
Text File
|
1998-03-01
|
30KB
|
725 lines
#ifndef EIFFEL_S2
#define EIFFEL_S2 1 /* Eiffel2 included */
/*------------------------------------------------------------------*/
#ifdef EDEBUG_2
#define EDEBUG_1 1
#endif
#ifdef EDEBUG_1
#define EDEBUG_0 1
#endif
/*------------------------------------------------------------------*/
/* Types */
/*------------------------------------------------------------------*/
typedef unsigned char BOOLEAN;
typedef char CHARACTER;
typedef double DOUBLE;
typedef long INTEGER;
typedef double REAL;
typedef unsigned char *OBJREF;
typedef unsigned char *POINTER;
/*------------------------------------------------------------------*/
/* Internal types */
/*------------------------------------------------------------------*/
typedef short INTEGER8;
typedef short INTEGER16;
/*------------------------------------------------------------------*/
typedef struct etype {
POINTER emod; /* Module belonging to this type */
struct etype **egen; /* Generic parameters */
INTEGER16 egencount; /* Number of generic parameters */
CHARACTER *ebase; /* Base class of type */
CHARACTER *ename; /* Full type name */
CHARACTER *ecode; /* Typecode; used for packing */
INTEGER16 ebits; /* Number of bits if BIT type */
BOOLEAN expanded; /* Is it an expanded type? */
INTEGER instances; /* Nr of instances of type */
INTEGER eindex; /* Used for packing */
struct etype *enext; /* Used for packing */
} ETYPE;
/*------------------------------------------------------------------*/
/* Macros */
/*------------------------------------------------------------------*/
#define true ((BOOLEAN) 1)
#define false ((BOOLEAN) 0)
#define VOIDREF ((OBJREF) 0)
/*------------------------------------------------------------------*/
/* Builtin C functions */
/*------------------------------------------------------------------*/
#define Emset(ccc, iii) (void) memset ((char *)(ccc), 0, (unsigned)(iii))
#if defined(__MWERKS__)
#define Esjmp(xxx) setjmp((long**)xxx)
#else
#define Esjmp(xxx) setjmp(xxx)
#endif /* __MWERKS__ */
/*------------------------------------------------------------------*/
/* Runtime frame */
/*------------------------------------------------------------------*/
typedef union {
INTEGER _ires; /* Integer result */
CHARACTER _cres; /* Character result */
BOOLEAN _bres; /* Boolean result */
REAL _rres; /* Real result */
POINTER _pres; /* Pointer result */
OBJREF _ores; /* Objref result */
ETYPE *_tres; /* Type result */
} ERES_TYPES;
typedef struct rtf {
INTEGER *_iap; /* Integer arguments */
CHARACTER *_cap; /* Character arguments */
BOOLEAN *_bap; /* Boolean arguments */
REAL *_rap; /* Real arguments */
POINTER *_pap; /* Pointer arguments */
OBJREF *_oap; /* Objref arguments */
INTEGER16 _oac; /* Number of objref args */
INTEGER *_i; /* Integer locals */
CHARACTER *_c; /* Character locals */
BOOLEAN *_b; /* Boolean locals */
REAL *_r; /* Real locals */
POINTER *_p; /* Pointer locals */
OBJREF *_o; /* Objref locals */
INTEGER16 _oc; /* Number of objref locals */
ERES_TYPES _res; /* Any result */
INTEGER16 etidx; /* Index in definition table*/
INTEGER16 epos; /* Current position */
POINTER emod; /* Call module */
struct rtf *next; /* Next runtime frame */
} RTF;
/*------------------------------------------------------------------*/
#define INIT_b(ddd,ttt) {Emset(_b,(ddd)*sizeof(ttt));_mf._b = _b;}
#define INIT_c(ddd,ttt) {Emset(_c,(ddd)*sizeof(ttt));_mf._c = _c;}
#define INIT_i(ddd,ttt) {Emset(_i,(ddd)*sizeof(ttt));_mf._i = _i;}
#define INIT_p(ddd,ttt) {Emset(_p,(ddd)*sizeof(ttt));_mf._p = _p;}
#define INIT_r(ddd,ttt) {Emset(_r,(ddd)*sizeof(ttt));_mf._r = _r;}
#define INIT_o(ddd,ttt) {Emset(_o,(ddd)*sizeof(ttt));_mf._o = _o;_mf._oc = ddd;}
#define INIT_oca(ddd,ttt) {Emset(_oca,(ddd)*sizeof(ttt));_mf._oac = ddd;}
#define RTF_init(iii) {Emset((&_mf),(sizeof(RTF)));\
_cfp->next = &_mf;\
_mf.etidx = (iii);\
_mf.emod = (POINTER) &md;}
#define RTF_restore {_mf.next = (RTF *) 0; *(md.erec) = _arec;}
#define RTF_return (_cfp->next = (RTF *) 0);
/*------------------------------------------------------------------*/
/* Function pointers */
/*------------------------------------------------------------------*/
typedef void (*EPER)(RTF *, BOOLEAN, INTEGER);
/*------------------------------------------------------------------*/
/* Library / class name pairs */
/*------------------------------------------------------------------*/
typedef struct {
INTEGER16 elib; /* Name of library */
INTEGER16 eclass; /* Name of class */
POINTER emod; /* The module of this pair */
} ELCP;
/*------------------------------------------------------------------*/
/* Parent table entries */
/*------------------------------------------------------------------*/
typedef struct {
CHARACTER ekind; /* Kind of entry */
INTEGER16 eidx; /* Index in library/class name pair table */
INTEGER16 eclause; /* Inheritance clause */
INTEGER16 ename1; /* First feature name */
INTEGER16 ename2; /* Second feature name */
EPER ptype; /* Typeof parent */
} EPAR;
/*------------------------------------------------------------------*/
/* Dispatch table entries */
/*------------------------------------------------------------------*/
/* Routine dispatch structures */
typedef struct {
EPER erp; /* Pointer to routine */
INTEGER16 ecnr; /* Class number */
} ERDLE;
typedef struct {
EPER erp; /* Pointer to routine */
INTEGER16 elcp; /* Index of ELCP structure */
INTEGER16 ename; /* Name of routine */
ERDLE *elist; /* Dispatch list */
INTEGER16 ecount; /* Number of entries in dispatch list */
} ERDS;
/* Data dispatch structures */
typedef struct {
INTEGER16 eoff; /* Offset of data */
INTEGER16 ecnr; /* Class number */
} EDDLE;
typedef struct {
INTEGER16 eoff; /* Offset of data */
INTEGER16 elcp; /* Index of ELCP structure */
INTEGER16 ename; /* Name of routine */
EDDLE *elist; /* Dispatch list */
INTEGER16 ecount; /* Number of entries in dispatch list */
} EDDS;
/* Typeof dispatch structures */
typedef struct {
EPER erp; /* Pointer to routine */
INTEGER16 ecnr; /* Class number */
} ETDLE;
typedef struct {
EPER erp; /* Pointer to routine */
INTEGER16 elcp; /* Index of ELCP structure */
INTEGER16 ename; /* Name of routine */
ETDLE *elist; /* Dispatch list */
INTEGER16 ecount; /* Number of entries in dispatch list */
} ETDS;
/*------------------------------------------------------------------*/
/* Dispatch macros */
/*------------------------------------------------------------------*/
#ifdef EFINAL
#define Erdisp(mmm,tgt,idx) (((POINTER) (Erdt[idx].erp)) == ((POINTER) (md.edefrout))) ? ((*(md.erdisp))(mmm, tgt, idx)) : (POINTER) (Erdt[idx].erp)
#define Eddisp(mmm,tgt,idx) (Eddt[idx].eoff) ? Eaddrof((tgt), (Eddt [idx].eoff)) : ((*(md.eddisp))(mmm, tgt, idx))
#define Etdisp(mmm,tgt,idx) ((*(md.etdisp))(mmm, tgt, idx))
#else
#define Erdisp(mmm,tgt,idx) (((POINTER) (Erdt[idx].erp)) == ((POINTER) (md.edefrout))) ? ((*(md.erdisp))(mmm, tgt, idx)) : (POINTER) (Erdt[idx].erp)
#define Eddisp(mmm,tgt,idx) ((tgt) && Eddt[idx].eoff) ? Eaddrof((tgt), (Eddt [idx].eoff)) : ((*(md.eddisp))(mmm, tgt, idx))
#define Etdisp(mmm,tgt,idx) ((*(md.etdisp))(mmm, tgt, idx))
#endif
#define Erhdisp(mmm,tgt,idx) (((POINTER) (Erdt[idx].erp)) == ((POINTER) (md.edefrout))) ? ((*(md.erhdisp))(mmm, tgt, idx)) : (POINTER) (Erdt[idx].erp)
#define Edhdisp(mmm,tgt,idx) ((tgt) && Eddt[idx].eoff) ? Eaddrof((tgt), (Eddt [idx].eoff)) : ((*(md.edhdisp))(mmm, tgt, idx))
#define Ethdisp(mmm,tgt,idx) ((*(md.ethdisp))(mmm, tgt, idx))
#define Echup(hhh) ((hhh) ? (hhh) : (*(md.evdisp))())
/*------------------------------------------------------------------*/
/* Routine and attribute definition tables */
/*------------------------------------------------------------------*/
typedef struct {
INTEGER16 ename; /* Name of routine */
EPER eaddr; /* Address of routine */
EPER etaddr; /* Address of typeof function */
INTEGER16 esig; /* Signature */
POINTER ebreak; /* Break points */
POINTER emod; /* Module pointer for Cecil */
} ERDEF;
typedef struct {
INTEGER16 ename; /* Name of attribute */
INTEGER16 eoff; /* Offset in data structure */
EPER etaddr; /* Address of typeof function */
CHARACTER ekind; /* Type indicator */
INTEGER16 esig; /* Signature */
} EDDEF;
/*------------------------------------------------------------------*/
/* Externals */
/*------------------------------------------------------------------*/
typedef struct {
POINTER eaddr; /* Address of external routine */
INTEGER16 ename; /* True name of external routine */
} EERS;
typedef struct {
POINTER eaddr; /* Address of external routine */
CHARACTER *ename; /* True name of external routine */
} RT_EERS;
/*------------------------------------------------------------------*/
typedef struct {
ETYPE *etd; /* A type descriptor */
INTEGER16 elcp; /* Index in ELCP structure */
} ETS;
/*------------------------------------------------------------------*/
/* Debug tables */
/*------------------------------------------------------------------*/
typedef struct {
CHARACTER *ekey; /* Debug key */
INTEGER16 eidx; /* Index of debug instruction */
} EDBKS;
/*------------------------------------------------------------------*/
/* Multi branch tables */
/*------------------------------------------------------------------*/
typedef struct {
INTEGER elower; /* Lower interval bound */
INTEGER eupper; /* Upper interval bound */
INTEGER16 ecode; /* Code number */
} EMBS;
#define Esel(ttt,iii) ((*(md.esel))(ttt,iii))
/*------------------------------------------------------------------*/
/* Module descriptor */
/*------------------------------------------------------------------*/
typedef struct mdesc {
CHARACTER *ename;
CHARACTER *elib;
ETYPE *etype;
INTEGER16 ecnr; /* Class number */
INTEGER16 esize; /* Size of an object */
POINTER (*erdisp)(RTF *, OBJREF, INTEGER); /* Runtime routine dispatcher */
POINTER (*eddisp)(RTF *, OBJREF, INTEGER); /* Runtime data dispatcher */
POINTER (*etdisp)(RTF *, OBJREF, INTEGER); /* Runtime type dispatcher */
POINTER (*erhdisp)(RTF *, OBJREF, INTEGER); /* Runtime routine dispatcher */
POINTER (*edhdisp)(RTF *, OBJREF, INTEGER); /* Runtime data dispatcher */
POINTER (*ethdisp)(RTF *, OBJREF, INTEGER); /* Runtime type dispatcher */
POINTER (*evdisp)(void);
void (*edefrout)(RTF *, BOOLEAN, INTEGER); /* Default routine = Runtime call through dispatcher */
int (*esel)(EMBS *, INTEGER); /* Runtime multi branch selection*/
OBJREF (*ecreate)(RTF *, ETYPE *);/* Runtime object creation */
OBJREF (*ebitcreate)(RTF *, CHARACTER *, ETYPE *);
OBJREF (*estrcreate)(RTF *, CHARACTER *, ETYPE *);
void (*einit)(RTF *); /* Module object initialization */
void (*rinit)(RTF *); /* Runtime object initialization */
void (*enoichk)(void); /* Runtime class inv. disable */
void (*echkvar)(INTEGER, INTEGER);
/* Runtime loop variant check */
void (*eraise)(void); /* Raise pending exceptions */
BOOLEAN (*exnotify)(BOOLEAN, int, char *);
void (*embex)(void); /* Raise multi-branch exception*/
/* Exception notify */
BOOLEAN (*exclr)(BOOLEAN); /* Clear exceptions */
void (*exvoid)(void); /* Void target exception */
OBJREF (*eiref)(INTEGER); /* Reference version */
OBJREF (*ecref)(CHARACTER); /* Reference version */
OBJREF (*ebref)(BOOLEAN); /* Reference version */
OBJREF (*erref)(REAL); /* Reference version */
OBJREF (*epref)(POINTER); /* Reference version */
ETYPE* (*egentype)(ETYPE *, int, ...);
/* Generic type creation */
ETYPE* (*ebittype)(ETYPE *, int); /* Bittype creation */
BOOLEAN (*eequal)(OBJREF, OBJREF); /* Standard equal */
INTEGER (*eipow)(INTEGER, INTEGER);/* Integer power operator */
REAL (*erpow)(REAL, INTEGER); /* Real power operator */
OBJREF (*enewbarr)(OBJREF, INTEGER, INTEGER);
OBJREF (*enewcarr)(OBJREF, INTEGER, INTEGER);
OBJREF (*enewearr)(OBJREF, INTEGER, INTEGER);
OBJREF (*enewiarr)(OBJREF, INTEGER, INTEGER);
OBJREF (*enewoarr)(OBJREF, INTEGER, INTEGER);
OBJREF (*enewparr)(OBJREF, INTEGER, INTEGER);
OBJREF (*enewrarr)(OBJREF, INTEGER, INTEGER);
void (*ecarrput)(OBJREF, CHARACTER, INTEGER);
void (*ebarrput)(OBJREF, BOOLEAN, INTEGER);
void (*eearrput)(OBJREF, OBJREF, INTEGER);
void (*eiarrput)(OBJREF, INTEGER, INTEGER);
void (*eoarrput)(OBJREF, OBJREF, INTEGER);
void (*eparrput)(OBJREF, POINTER, INTEGER);
void (*erarrput)(OBJREF, REAL, INTEGER);
CHARACTER (*ecarritem)(OBJREF, INTEGER);
BOOLEAN (*ebarritem)(OBJREF, INTEGER);
OBJREF (*eearritem)(OBJREF, INTEGER);
INTEGER (*eiarritem)(OBJREF, INTEGER);
OBJREF (*eoarritem)(OBJREF, INTEGER);
POINTER (*eparritem)(OBJREF, INTEGER);
REAL (*erarritem)(OBJREF, INTEGER);
OBJREF (*eassat)(ETYPE *, OBJREF); /* Assignment attempt */
OBJREF (*eclone)(OBJREF); /* Standard clone */
void (*ecopy)(OBJREF, OBJREF); /* Standard copy */
int* (*enewenv)(void); /* New environment (setjmp) */
void (*efreeenv)(int**);
void (*eprotect)(OBJREF *, INTEGER); /* Protect from GC */
EPER eclinv; /* Runtime class invariant check */
EPER einv; /* Own class invariant routine */
void (*epos)(RTF *, RTF *, INTEGER, POINTER);
void (*einout)(RTF *, RTF *, BOOLEAN, POINTER);
ELCP *elcp;
ETS *ett;
EDDS *eddt;
ERDS *erdt;
ETDS *etdt;
EERS *eert;
ERDEF *erdef;
EDDEF *eddef;
BOOLEAN *edbt;
EDBKS *edbkt;
BOOLEAN elinv; /* Loop invariant checks */
BOOLEAN elvar; /* Loop variant checks */
BOOLEAN echk; /* Check assertions */
BOOLEAN epre; /* Preconditions */
BOOLEAN epost; /* Postconditions */
BOOLEAN edbg; /* Debug instructions */
BOOLEAN ecinv; /* Class invariant */
INTEGER *erec; /* Assertion recursion */
EPAR *epart; /* Parent table */
POINTER plinks;
POINTER dlinks;
POINTER memory;
BOOLEAN eattrs;
INTEGER16 eidata [16]; /* Offsets of intrinsic data */
EPER eirout [16]; /* Addresses of intrinsic routines */
CHARACTER espec_kind; /* Kind of special object */
BOOLEAN ebreak; /* Does it have break points?*/
char **estr;
char **eestr;
struct mdesc *enext;
} EMDESC;
/*------------------------------------------------------------------*/
#define Ecreate (*(md.ecreate))
#define Ebitcreate (*(md.ebitcreate))
#define Estrcreate (*(md.estrcreate))
#define Eclone (*(md.eclone))
#define Ecopy (*(md.ecopy))
#define Einit (*(md.rinit))
#define Ecreation (*(md.enoichk))
#define Eclinv(fff,qqq) (*(md.eclinv))(fff,qqq,0)
#define Eraise (*(md.eraise))
#define Eexnotify (*(md.exnotify))
#define Eexclr(bbb) (*(md.exclr))((BOOLEAN)(bbb))
#define Eiref (*(md.eiref))
#define Ecref (*(md.ecref))
#define Ebref (*(md.ebref))
#define Erref (*(md.erref))
#define Epref (*(md.epref))
#define Eiwrap (*(md.eiref))
#define Ecwrap (*(md.ecref))
#define Ebwrap (*(md.ebref))
#define Erwrap (*(md.erref))
#define Epwrap (*(md.epref))
#define Egentype (*(md.egentype))
#define Ebittype (*(md.ebittype))
#define Eequal (*(md.eequal))
#define Eipow (*(md.eipow))
#define Erpow (*(md.erpow))
#define Enewbarr (*(md.enewbarr))
#define Enewcarr (*(md.enewcarr))
#define Enewearr (*(md.enewearr))
#define Enewiarr (*(md.enewiarr))
#define Enewoarr (*(md.enewoarr))
#define Enewparr (*(md.enewparr))
#define Enewrarr (*(md.enewrarr))
#define Ebarrput (*(md.ebarrput))
#define Ecarrput (*(md.ecarrput))
#define Eearrput (*(md.eearrput))
#define Eiarrput (*(md.eiarrput))
#define Eoarrput (*(md.eoarrput))
#define Eparrput (*(md.eparrput))
#define Erarrput (*(md.erarrput))
#define Enew_env (*(md.enewenv))
#define Efree_env (*(md.efreeenv))
#define Echkvar (*(md.echkvar))
#define Embex (*(md.embex))
#define Eassat (*(md.eassat))
#define Eprotect (*(md.eprotect))
/*------------------------------------------------------------------*/
typedef union {
EMDESC *mod;
POINTER hdr;
} EGPU;
typedef struct {
ETYPE *type;
EGPU gpu;
INTEGER gct;
} EHDR;
/*------------------------------------------------------------------*/
#define Eheader(ooo) ((EHDR *)(((char *) (ooo)) - sizeof (EHDR)))
#define Etypeof(ooo) (Eheader(ooo)->type)
#define Eactgen(iii) ((Etypeof((*(_cfp->_oap)))->egen)[iii])
#define Eaddrof(ooo,iii) ((POINTER) (((char *) (ooo))+((iii)-1)))
#define Emodof(ooo) ((Eheader(ooo)->gpu).mod)
/*------------------------------------------------------------------*/
/* Assertion control */
/*------------------------------------------------------------------*/
#if defined(__MWERKS__)
/* The recursion control stuff does not seem to be implemented fully.
It will be important for at least class invariants. */
#define Elinv (md.elinv)
#define Elvar (md.elvar)
#define Echk (md.echk)
#define Epre (md.epre)
#define Epost (md.epost)
#define Epost_old (md.epost)
#define Edbg (md.edbg)
#define Ecinv (md.ecinv)
#else
#define Elinv (md.elinv && !(*md.erec) && (++(*(md.erec))))
#define Elvar (md.elvar && !(*md.erec) && (++(*(md.erec))))
#define Echk (md.echk && !(*md.erec) && (++(*(md.erec))))
#define Epre (md.epre && !(*md.erec) && (++(*(md.erec))))
#define Epost (md.epost && !(*md.erec) && (++(*(md.erec))))
#define Epost_old (md.epost && !(*md.erec))
#define Edbg (md.edbg && !(*md.erec) && (++(*(md.erec))))
#define Ecinv (md.ecinv && !(*md.erec) && (++(*(md.erec))))
#endif /* __MWERKS__ */
#define EPCV 1 /* precondition violation */
#define EPOCV 2 /* postcondition " */
#define ECHKV 3 /* check assertions " */
#define ELINV 4 /* loop invariant */
#define ELVAV 5 /* loop variant */
#define ECINV 6 /* class invariant */
/*------------------------------------------------------------------*/
/* Intrinsic Macros */
/*------------------------------------------------------------------*/
#define EI_IIEQ(xx,yy) ((xx)==(yy))
#define EI_IEQ(oo,xx,yy) ((xx)==(yy))
#define EI_ICP(xx,yy) (xx = (yy))
#define EI_ICL(oo,xx) (xx)
#define EI_IDCL(oo,xx) (xx)
#define EI_IDEQ(oo,xx,yy) ((xx)==(yy))
#define EI_IMIN(xx,yy) (((xx)<(yy)) ? (xx) : (yy))
#define EI_IMAX(xx,yy) (((yy)<(xx)) ? (xx) : (yy))
#define EI_ICMP(xx,yy) ((xx)-(yy))
#define EI_IHSH(xx) (((xx)<0) ? -(xx) : (xx))
#define EI_CIEQ(xx,yy) ((xx)==(yy))
#define EI_CEQ(oo,xx,yy) ((xx)==(yy))
#define EI_CCP(xx,yy) (xx = (yy))
#define EI_CCL(oo,xx) (xx)
#define EI_CDCL(oo,xx) (xx)
#define EI_CDEQ(oo,xx,yy) ((xx)==(yy))
#define EI_CMIN(xx,yy) (((xx)<(yy)) ? (xx) : (yy))
#define EI_CMAX(xx,yy) (((yy)<(xx)) ? (xx) : (yy))
#define EI_CCMP(xx,yy) (((int)(xx))-((int) (yy)))
#define EI_CHSH(xx) ((INTEGER)((unsigned char) (xx)))
#define EI_RIEQ(xx,yy) ((xx)==(yy))
#define EI_REQ(oo,xx,yy) ((xx)==(yy))
#define EI_RCP(xx,yy) (xx = (yy))
#define EI_RCL(oo,xx) (xx)
#define EI_RDCL(oo,xx) (xx)
#define EI_RDEQ(oo,xx,yy) ((xx)==(yy))
#define EI_RMIN(xx,yy) (((xx)<(yy)) ? (xx) : (yy))
#define EI_RMAX(xx,yy) (((yy)<(xx)) ? (xx) : (yy))
#define EI_RCMP(xx,yy) (((xx)<(yy)) ? -1 : (((xx)>(yy)) ? 1 : 0))
#define EI_RHSH(xx) (0)
#define EI_BIEQ(xx,yy) ((xx)==(yy))
#define EI_BEQ(oo,xx,yy) ((xx)==(yy))
#define EI_BCP(xx,yy) (xx = (yy))
#define EI_BCL(oo,xx) (xx)
#define EI_BDCL(oo,xx) (xx)
#define EI_BDEQ(oo,xx,yy) ((xx)==(yy))
#define EI_PIEQ(xx,yy) ((xx)==(yy))
#define EI_PEQ(oo,xx,yy) ((xx)==(yy))
#define EI_PCP(xx,yy) (xx = (yy))
#define EI_PCL(oo,xx) (xx)
#define EI_PDCL(oo,xx) (xx)
#define EI_PDEQ(oo,xx,yy) ((xx)==(yy))
/*------------------------------------------------------------------*/
/* Offsets of intrinsic data */
/*------------------------------------------------------------------*/
#define EI_AR_OFF 0 /* Offset of area */
#define EI_CO_OFF 1 /* Offset of count */
#define EI_EX_OFF 2 /* Offset of exchg */
#define EI_FA_OFF 3 /* Offset of faptr */
#define EI_LI_OFF 4 /* Offset of lit */
#define EI_LO_OFF 5 /* Offset of lower */
#define EI_SP_OFF 6 /* Offest of special */
#define EI_UP_OFF 7 /* Offset of upper */
#define EI_IDATA(ooo,nnn) Eaddrof((ooo),((Emodof(ooo)->eidata)[nnn]))
#ifdef EFINAL
#define EI_BAITM(ooo,iii) ((*((BOOLEAN**)EI_IDATA(ooo,EI_FA_OFF)))[iii])
#define EI_CAITM(ooo,iii) ((*((CHARACTER**)EI_IDATA(ooo,EI_FA_OFF)))[iii])
#define EI_EAITM(ooo,iii) ((*((OBJREF**)EI_IDATA(ooo,EI_FA_OFF)))[iii])
#define EI_IAITM(ooo,iii) ((*((INTEGER**)EI_IDATA(ooo,EI_FA_OFF)))[iii])
#define EI_OAITM(ooo,iii) ((*((OBJREF**)EI_IDATA(ooo,EI_FA_OFF)))[iii])
#define EI_PAITM(ooo,iii) ((*((POINTER**)EI_IDATA(ooo,EI_FA_OFF)))[iii])
#define EI_RAITM(ooo,iii) ((*((REAL**)EI_IDATA(ooo,EI_FA_OFF)))[iii])
#define EI_BAPUT(ooo,xxx,iii) (((*((BOOLEAN**)EI_IDATA(ooo,EI_FA_OFF)))[iii])=xxx)
#define EI_CAPUT(ooo,xxx,iii) (((*((CHARACTER**)EI_IDATA(ooo,EI_FA_OFF)))[iii])=xxx)
#define EI_EAPUT(ooo,xxx,iii) (((*((OBJREF**)EI_IDATA(ooo,EI_FA_OFF)))[iii])=xxx)
#define EI_IAPUT(ooo,xxx,iii) (((*((INTEGER**)EI_IDATA(ooo,EI_FA_OFF)))[iii])=xxx)
#define EI_OAPUT(ooo,xxx,iii) (((*((OBJREF**)EI_IDATA(ooo,EI_FA_OFF)))[iii])=xxx)
#define EI_PAPUT(ooo,xxx,iii) (((*((POINTER**)EI_IDATA(ooo,EI_FA_OFF)))[iii])=xxx)
#define EI_RAPUT(ooo,xxx,iii) (((*((REAL**)EI_IDATA(ooo,EI_FA_OFF)))[iii])=xxx)
#else
#define EI_BAITM(ooo,iii) (md.ebarritem((ooo),(iii)))
#define EI_CAITM(ooo,iii) (md.ecarritem((ooo),(iii)))
#define EI_EAITM(ooo,iii) (md.eearritem((ooo),(iii)))
#define EI_IAITM(ooo,iii) (md.eiarritem((ooo),(iii)))
#define EI_OAITM(ooo,iii) (md.eoarritem((ooo),(iii)))
#define EI_PAITM(ooo,iii) (md.eparritem((ooo),(iii)))
#define EI_RAITM(ooo,iii) (md.erarritem((ooo),(iii)))
#define EI_BAPUT(ooo,xxx,iii) (md.ebarrput((ooo),(xxx),(iii)))
#define EI_CAPUT(ooo,xxx,iii) (md.ecarrput((ooo),(xxx),(iii)))
#define EI_EAPUT(ooo,xxx,iii) (md.eearrput((ooo),(xxx),(iii)))
#define EI_IAPUT(ooo,xxx,iii) (md.eiarrput((ooo),(xxx),(iii)))
#define EI_OAPUT(ooo,xxx,iii) (md.eoarrput((ooo),(xxx),(iii)))
#define EI_PAPUT(ooo,xxx,iii) (md.eparrput((ooo),(xxx),(iii)))
#define EI_RAPUT(ooo,xxx,iii) (md.erarrput((ooo),(xxx),(iii)))
#endif
#define EI_BALOW(ooo) (*((INTEGER *)EI_IDATA(ooo,EI_LO_OFF)))
#define EI_CALOW(ooo) (*((INTEGER *)EI_IDATA(ooo,EI_LO_OFF)))
#define EI_EALOW(ooo) (*((INTEGER *)EI_IDATA(ooo,EI_LO_OFF)))
#define EI_IALOW(ooo) (*((INTEGER *)EI_IDATA(ooo,EI_LO_OFF)))
#define EI_OALOW(ooo) (*((INTEGER *)EI_IDATA(ooo,EI_LO_OFF)))
#define EI_PALOW(ooo) (*((INTEGER *)EI_IDATA(ooo,EI_LO_OFF)))
#define EI_RALOW(ooo) (*((INTEGER *)EI_IDATA(ooo,EI_LO_OFF)))
#define EI_BAUP(ooo) (*((INTEGER *)EI_IDATA(ooo,EI_UP_OFF)))
#define EI_CAUP(ooo) (*((INTEGER *)EI_IDATA(ooo,EI_UP_OFF)))
#define EI_EAUP(ooo) (*((INTEGER *)EI_IDATA(ooo,EI_UP_OFF)))
#define EI_IAUP(ooo) (*((INTEGER *)EI_IDATA(ooo,EI_UP_OFF)))
#define EI_OAUP(ooo) (*((INTEGER *)EI_IDATA(ooo,EI_UP_OFF)))
#define EI_PAUP(ooo) (*((INTEGER *)EI_IDATA(ooo,EI_UP_OFF)))
#define EI_RAUP(ooo) (*((INTEGER *)EI_IDATA(ooo,EI_UP_OFF)))
/*------------------------------------------------------------------*/
/* Addresses of intrinsic routines */
/*------------------------------------------------------------------*/
#define EI_CP_ADR 0 /* copy */
#define EI_EQ_ADR 1 /* is_equal */
/*------------------------------------------------------------------*/
#if defined(__MWERKS__)
#include <setjmp.h>
#else
#define setjmp _setjmp
/*------------------------------------------------------------------*/
extern int setjmp (int *);
#endif /* __MWERKS__ */
/*------------------------------------------------------------------*/
#ifdef EDEBUG_2
#define EPOS(ppp) {(*(md.epos))(_cfp, &_mf, ppp, (POINTER)emap);}
#define ENTER {(*(md.einout))(_cfp, &_mf,false,(POINTER)emap);}
#define LEAVE {(*(md.einout))(_cfp, &_mf,true,(POINTER)emap);}
#define EMOD
#else
#ifndef EFINAL
#define EPOS(ppp)
#define ENTER if ((_cfp->_oap != (OBJREF *) 0) && (*(_cfp->_oap) == VOIDREF)) (*(md.exvoid))();
#define LEAVE
#define EMOD
#else
#define EPOS(ppp)
#define ENTER
#define LEAVE
#define EMOD
#endif
#endif
/*------------------------------------------------------------------*/
typedef struct {
INTEGER16 ename;
INTEGER16 cname;
} EMAP;
#endif /* EIFFEL_S2 */
/*------------------------------------------------------------------*/